<template>
  <view class="seach-wrap">
    <u-search 
      :placeholder="placeholder"
      color="#FF6A60"
      search-icon-color="rgba(255, 106, 96, 0.8)"
      placeholder-color="rgba(255, 106, 96, 0.8)"
      height="75"
      margin="0 30rpx"
      :action-style="{
        color: '#fff',
        'font-weight': 'bold'
      }"
      :maxlength="5"
      @custom="search"
      v-model="keyword"
    />
  </view>
</template>

<script setup>
  import { ref } from 'vue'
  const props = defineProps({
    placeholder: {
      type: String,
      default: '请输入姓氏或关键字'
    }
  })
  let keyword = ref('')
  const emits = defineEmits(['search'])
  const search = () => {
    emits('search', keyword.value)
  }
</script>

<style lang="scss">
  .seach-wrap {
    padding: 20rpx 40rpx;
    background: #eccdcb;
  }
</style>